﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Remoting.Messaging;
using Project.MODEL;

namespace Project.DAL
{
    public class DbContextFactory
    {
        /// <summary>
        /// 获取上下文
        /// </summary>
        /// <returns></returns>
        public static PSSEntities Create() {
            PSSEntities entities = CallContext.GetData("dbcontext") as PSSEntities;
            if (entities==null)
            {
                entities = new PSSEntities();
                CallContext.SetData("dbcontext", entities);
            }
            return entities;
        }
        
    }
}
